import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
// Administrator
import AdministratorIndex from '@/components/administrator/Index'
import AdministratorContainer from '@/components/administrator/components/StoreContainer'
import AdContainer from '@/components/administrator/components/AdContainer'
import ComplainContainer from '@/components/administrator/components/ComplainContainer'
// Merchant
import MerchantIndex from '@/components/merchant/Index'
import MerchantContainer from '@/components/merchant/components/Container'
import MerchantLogin from '@/components/merchant/MerchantLogin'
import ApplyStore from '@/components/merchant/ApplyStore'
import Orders from '@/components/merchant/components/Orders'
import MerchantMsg from '@/components/merchant/components/MerchantMsg'
import ProductCard from '@/components/merchant/components/ProductCard'
import StoreMsg from '@/components/merchant/components/StoreMsg'
import AdPush from '@/components/merchant/components/AdPush'
// Customer
import CustomerIndex from '@/components/customer/Index'
import CustomerContainer from '@/components/customer/components/Container'
import CustomerLogin from '@/components/customer/Login'
import CustomerStore from '@/components/customer/components/Store'
import CustomerOrderDetails from '@/components/customer/components/OrderDetail'
import CustomerDashboard from '@/components/customer/components/Dashboard'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index
    },
    {
      path: '/administrator',
      name: 'AdministratorIndex',
      component: AdministratorIndex,
      children: [
        {path: '/', name: 'AdministratorContainer', component: AdministratorContainer}
      ]
    },
    {
      path: '/administrator/ads',
      name: 'AdministratorIndex',
      component: AdministratorIndex,
      children: [
        {path: '/', name: 'AdContainer', component: AdContainer}
      ]
    },
    {
      path: '/administrator/complains',
      name: 'AdministratorIndex',
      component: AdministratorIndex,
      children: [
        {path: '/', name: 'ComplainContainer', component: ComplainContainer}
      ]
    },
    {
      path: '/merchant',
      name: 'MerchantIndex',
      component: MerchantIndex,
      children: [
        {path: '/', name: 'MerchantContainer', component: MerchantContainer},
        {path: '/orders', name: 'Orders', component: Orders},
        {path: '/merchantMsg', name: 'MerchantMsg', component: MerchantMsg},
        {path: '/productCard', name: 'ProductCard', component: ProductCard},
        {path: '/storeMsg', name: 'StoreMsg', component: StoreMsg},
        {path: '/adPush', name: 'AdPush', component: AdPush}
      ]
    },
    {
      path: '/customer',
      name: 'CustomerIndex',
      component: CustomerIndex,
      children: [
        {path: '/', name: 'CustomerContainer', component: CustomerContainer, meta: {index: 0}},
        {path: 'store/:id', name: 'CustomerStore', component: CustomerStore, meta: {index: 1}},
        {path: 'order', name: 'CustomerOrderDetails', component: CustomerOrderDetails, meta: {index: 2}},
        {path: 'dashboard', name: 'CustomerDashboard', component: CustomerDashboard, meta: {index: 3}}
      ]
    },
    {
      path: '/customer/login/:forward',
      name: 'CustomerLogin',
      component: CustomerLogin
    },
    {
      path: '/merchant/login',
      name: 'MerchantLogin',
      component: MerchantLogin
    },
    {
      path: '/merchant/applyStore',
      name: 'ApplyStore',
      component: ApplyStore
    }
  ]
})
